package com.bobi.ecofavor.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bobi.ecofavor.model.domain.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 订单 Mapper 接口
 * </p>
 *
 * @author wenyuan
 * @since 2023-10-21
 */
@Repository
public interface OrderMapper extends BaseMapper<Order> {

    String selectChildrenOrder(Wrapper<Order> orderWrapper);

    Boolean insertOrder(@Param("order") Order order);

    List<Order> selectBrotherOrders(@Param("orderId") Integer orderId);

    int cancleParentOrder(@Param("orderId") Integer orderId);

    Order getParentOrder(@Param("orderId") Integer id);
}
